package org.example.everyday;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * <p>
 *
 * @author anlu
 * @date 2022/4/11 0011 21:12
 */
public class Lc357 {

    public static void main(String[] args) {
        Lc357 lc357 = new Lc357();
        int result = lc357.countNumbersWithUniqueDigits(3);
        System.out.println(result);
    }

    public int countNumbersWithUniqueDigits(int n) {
        if(n == 0){
            return 1;
        }
        if(n == 1){
            return 10;
        }
        int res = 0,cur = 9;
        for(int i = 0; i < n - 1; i++){
            cur *= 9 - i;
            res += cur;
        }
        return res;
    }
}
